package com.zero.business.order.feign.sentinel;

import com.zero.business.order.feign.OrderMemberFeign;
import com.zero.common.constants.CodeConstants;
import com.zero.common.exception.ServiceException;
import com.zero.domain.Member;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/*
*   OrderMemberFeign 的降级方法类
* */
@Component  // 放入spring容器中
public class OrderMemberFeignSentinel implements OrderMemberFeign {

    /*
    *   服务降级方法
    * */
    @Override
    public Member selectByPrimaryKey(Integer userId) {

        throw new ServiceException(CodeConstants.LOWER_SERVICE,"操作失败，订单模块 远程调用 会员模块 的服务已被降级或熔断1");

    }


    /*
     *   服务降级方法
     * */
    @Override
    public void updateByPrimaryKeySelective(Integer userId, String status, BigDecimal money, Integer score, String remark) {

        throw new ServiceException(CodeConstants.LOWER_SERVICE,"操作失败，订单模块 远程调用 会员模块 的服务已被降级或熔断2");

    }




}
